#pragma once
#include <iostream>
#include <string>
#include <bitset>
#include <sstream>
#include <io.h> // 
#include <stdio.h>
#include <list>
#include <vector>
#include <map>
#include <algorithm>

class test41_MyUtilsSet
{
public:
	void classMain();
};

// ip工具
namespace IpUtils {
	void ipTest();
	std::string decimalToBinary(std::string decimalAddress);
	std::string binaryToDecimal(std::string binaryAddress);
	std::string getSubnetMask(std::string subnetMask);
	std::string calculateSubnetPrefix(std::string ipAddress, std::string subnetMask, std::string& subnetPrefix, int& prefixLength);

}

// 文件，文件夹工具 = 只适用于windows
namespace FileUtils {
	struct myFolderInfo
	{
		int curLevel = 0; //当前层级
		std::string curPath; // 当前路径
		std::string type; // 判断是文件还是文件夹
		int64_t curSize; // 当前文件大小,文件夹大小为0
	};

	void folderTest();
	void voisFolder(const std::string& folderPath);
	std::vector<std::string> splitString(const std::string& str, const std::string& delimiter);
	bool compareByCurLevel(const FileUtils::myFolderInfo& a, const FileUtils::myFolderInfo& b);
	void voisFolderWithLevel(const std::string& folderPath, int curLevel, std::list<FileUtils::myFolderInfo>& folderList);
	void myVoisFolderWithLevel(const std::string& folderPath, const int& level);
}

